﻿<!DOCTYPE HTML>
<html lang="zh">
<head>
<title>驱动器函数列表 | AutoHotkey v2</title>
<meta name="description" content="This page lists functions for retrieving various types of information about the computer's drive(s), or making a variety of changes to a drive." />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>驱动器函数</h1>

<p>用于检索有关计算机驱动器的各种类型的信息, 或对驱动器进行各种更改的函数. 点击函数名获取详细信息.</p>
<table class="info">
    <tr>
        <th>函数</th>
        <th abbr="Descr">描述</th>
    </tr>
    <tr>
        <td><a href="DriveEject.htm">DriveEject</a></td>
        <td>弹出指定 CD/DVD 驱动器的托盘, 或弹出可移动驱动器.</td>
    </tr>
    <tr>
        <td><a href="DriveGetCapacity.htm">DriveGetCapacity</a></td>
        <td>返回包含指定路径的驱动器的总容量, 单位为 mb(兆字节).</td>
    </tr>
    <tr>
        <td><a href="DriveGetFileSystem.htm">DriveGetFileSystem</a></td>
        <td>返回指定驱动器的文件系统的类型.</td>
    </tr>
    <tr>
        <td><a href="DriveGetLabel.htm">DriveGetLabel</a></td>
        <td>返回指定驱动器的卷标.</td>
    </tr>
    <tr>
        <td><a href="DriveGetList.htm">DriveGetList</a></td>
        <td>返回一串字母, 系统中的每个驱动器字母对应一个字符.</td>
    </tr>
    <tr>
        <td><a href="DriveGetSerial.htm">DriveGetSerial</a></td>
        <td>返回指定驱动器的卷序列号.</td>
    </tr>
    <tr>
        <td><a href="DriveGetSpaceFree.htm">DriveGetSpaceFree</a></td>
        <td>包含指定路径的驱动器的空闲磁盘空间, 单位为 mb(兆字节).</td>
    </tr>
    <tr>
        <td><a href="DriveGetStatus.htm">DriveGetStatus</a></td>
        <td>返回包含指定路径的驱动器的状态.</td>
    </tr>
    <tr>
        <td><a href="DriveGetStatusCD.htm">DriveGetStatusCD</a></td>
        <td>返回指定 CD/DVD 驱动器的媒体状态.</td>
    </tr>
    <tr>
        <td><a href="DriveGetType.htm">DriveGetType</a></td>
        <td>返回包含指定路径的驱动器类型.</td>
    </tr>
    <tr>
        <td><a href="DriveLock.htm">DriveLock</a></td>
        <td>阻止指定驱动器的弹出功能正常工作.</td>
    </tr>
    <tr>
        <td><a href="DriveEject.htm">DriveRetract</a></td>
        <td>收回指定 CD/DVD 驱动器的托盘.</td>
    </tr>
    <tr>
        <td><a href="DriveSetLabel.htm">DriveSetLabel</a></td>
        <td>更改指定驱动器的卷标签.</td>
    </tr>
    <tr>
        <td><a href="DriveUnlock.htm">DriveUnlock</a></td>
        <td>恢复指定驱动器的弹出功能.</td>
    </tr>
</table>

<h2 id="Error_Handling">错误处理</h2>
<p>失败时抛出异常.</p>

<h2 id="Related">相关</h2>
<p><a href="index.htm">所有函数列表</a></p>

<h2 id="Examples">示例</h2>
<div class="ex" id="ExAnalyzeDrive">
<p><a class="ex_number" href="#ExAnalyzeDrive"></a> 允许用户选择一个驱动器来分析它.</p>
<pre>folder := DirSelect( , 3, "Pick a drive to analyze:")
if not folder
    return
MsgBox
(
    "All Drives: " DriveGetList() "
    Selected Drive: " folder "
    Drive Type: " DriveGetType(folder) "
    Status: " DriveGetStatus(folder) "
    Capacity: " DriveGetCapacity(folder) " MB
    Free Space: " DriveGetSpaceFree(folder) " MB
    Filesystem: " DriveGetFilesystem(folder) "
    Volume Label: " DriveGetLabel(folder) "
    Serial Number: " DriveGetSerial(folder)
)</pre>
</div>

</body>
</html>